package com.example.thirdannotation.y2022.annotation.controller;

import com.alibaba.fastjson.JSON;
import com.example.thirdannotation.y2022.annotation.entity.BrandEntity;
import com.example.thirdannotation.y2022.annotation.utils.DemoUtil;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

/**
 * @author: dangwen
 * @createDate: 2021/10/17
 */
@RestController
@RequestMapping("annotation")
//@Validated
public class AnnotationTestController {
    @GetMapping("test")
    public void test(@Valid BrandEntity brandEntity){
        System.out.println(brandEntity);
    }

    @GetMapping("getSex")
    public String getDemoAge(String sex){
        System.out.println("gg:"+JSON.toJSONString(DemoUtil.getMap()));
        return DemoUtil.getMyAge(sex);
    }
}
